package cn.idietrade.idietradegoodsorder8003.demo.service;

import cn.idietrade.common.pojo.SecondGoods;
import cn.idietrade.common.pojo.SecondOrder;
import cn.idietrade.common.utils.ReturnResultData;
import cn.idietrade.common.utils.SecondOrderPage;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface OrderService{

     //订单生成到Redis
     ReturnResultData createOrderRedis(Integer buyerId,String goodsId,Integer goodsNum);

     //订单生成到mysql
     ReturnResultData createOrder(List<SecondOrder> orderList);

     //订单内商品部分取消购买
     ReturnResultData removeOrderGoodsInfo(Integer goodsId);

     //订单状态修改
     ReturnResultData updateOrderState(Integer orderState,String orderNo);

     SecondOrder queryRedisLSOrder(Integer userId);

     boolean deleteRedisLSOrder(Integer userId);


     //查询订单表最大id
     int selectOrderNums();

     //生成订单
     int addOrder(SecondOrder secondOrder,String goodsIds,String nums);

     //查询所有订单下的所有商品信息
     SecondOrderPage querySecondOrders(Integer pageNum, Integer pageSize, Integer userId);

     //验签时通过订单编号查出订单id
     int queryOrderId(String orderNo);

     //通过订单id修改订单状态
     int updateOrState(Integer orderId,Integer orderState);
}
